home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-68k-src / machines / amiga68k / libsrc / time / time.c < prev   
C/C++ Source or Header  |  1999-01-01  |  505b  |  24 lines

  1. #include <time.h>
  2. #include <dos/dos.h>
  3.  
  4. #include <proto/dos.h>
  5.  
  6. extern long __gmtoffset;
  7.  
  8. time_t time(time_t *tloc)
  9. { struct DateStamp t;
  10.   time_t ti;
  11.   DateStamp(&t); /* Get timestamp */
  12.   ti=((t.ds_Days+2922)*1440+t.ds_Minute+__gmtoffset)*60+
  13.      t.ds_Tick/TICKS_PER_SECOND;
  14.   if(tloc!=NULL)
  15.     *tloc=ti;
  16.   return ti;
  17. }
  18.  
  19. /*
  20.  * 2922 is the number of days between 1.1.1970 and 1.1.1978 (2 leap years and 6 normal)
  21.  * 1440 is the number of minutes per day
  22.  *   60 is the number of seconds per minute
  23.  */
  24.